#include "Menu.h"
#include "Customer.h"
#include <iostream>
#include <fstream>
//additional includes


using namespace std;

Menu::Menu()
{
}

void Menu::display_main_menu() const 
{
	cout << "Here is the MAIN MENU \n";
}
void Menu::display_info() const
{
	cout << "Here is the Info requested \n";//display Project Part I, team name and team members
}

void Menu::read()
{
	cout << "Read file name then read store data \n";
	//start part SS-A1 : read and store customer data from file to memory (all added in this part)
	ifstream cust_input; //SS-A1 reading customer data
	int ndata, addr_num, addr_zip, cust_id; //SS-A1 
	string cust_name, addr_name; //SS-A1 
	custs.clear(); //clearing containers before reading SS-A1 
	cust_input.open("../Sample_Data/Cust.dat");  //SS-A1 
	if(!cust_input) cerr<<"Error : no such file input\n";  //SS-A1 
	cust_input>>ndata;  //SS-A1 
	for(int i=0;i<ndata;++i)  //SS-A1 
	{
		cust_input>>cust_id; //SS-A1
		cust_input>>cust_name; //SS-A1
		cust_input>>addr_num; //SS-A1
		cust_input>>addr_name; //SS-A1
		cust_input>>addr_zip; //SS-A1
		custs.push_back(Customer(cust_id,cust_name,Address(addr_num, addr_name, addr_zip))); //SS-A1
	}
	cust_input.close(); //end SS-A1
}
void Menu::show() const 
{
	cout << "Show queries \n";
		
}
void Menu::find() const 
{
	cout << "Find queries \n";
}
void Menu::update()  
{
	cout << "Update queries \n";
}